<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="java.io.InputStreamReader,java.io.IOException,java.io.PrintWriter,java.sql.ResultSet,
java.util.ArrayList,javax.servlet.ServletException,javax.servlet.annotation.WebServlet,javax.servlet.http.HttpServlet,

javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,org.apache.log4j.Logger,com.grantha.util.DB,com.mysql.jdbc.Connection
,com.mysql.jdbc.PreparedStatement" %>	
<!DOCTYPE html>
<html>
<head>
<jsp:include page="/jsp/header.jsp" />
<title>Patron Entry</title>
    <%
    	int maxPatNo = 0;
    	try {
            

            	ResultSet rs = DB.search("select max(patno) as patnomax from patronregister", null);
     	        if(rs.next()) {
     	        	maxPatNo = Integer.parseInt(rs.getString("patnomax")) +1 ;
     	        	
     	        }

    		rs.close();

    	}catch (Exception e) {
    		System.err.print("Sorry");
    	}
    %>
</head>
<body>
	<div id="addPatronDiv" class="page2" style="width: 680px;">
		<form id="borrowerEntryForm" method="post"
			action="${WEB_BASE}BorrowerEntryServlet">
			<div class="error" style="display:none;">
		      <img src="${WEB_BASE }images/warning.gif" alt="Warning!" width="24" height="24" style="float:left; margin: -5px 10px 0px 0px; ">
		
		      <span></span>.<br clear="all">
		    </div>
			<div id="vwcontainer">
				<table>
					<tr>
						<td>Member ID:</td>
						<td><input type="text" name="serial"id="memid" class="required"
							style="width: 250px;" readonly value="<%=maxPatNo%>"/></td>
					</tr>
					<tr>
						<td>Burrower's Name:</td>
						<td><input class="required" style="width: 250px;" type="text"
							name="name"id="name"  /></td>
					</tr>
					<tr>
						<td>Sex:</td>
						<td><input type="radio" value="Mr" name="jradiobutton1" checked="checked" />
							Male<input type="radio" value="Mrs" name="jradiobutton1" />Female</td>
					</tr>
					<tr>
						<td>Address:</td>
						<td><input class="required" style="width: 250px;" type="text"id="address" 
							name="address" style="height:40px;" /></td>
					</tr>
					<tr>
						<td>Phone Number:</td>
						<td><input class="required" style="width: 250px;" type="tel"
							name="phone"id="pnum" /></td>
					</tr>
					<tr>
						<td>Designation:</td>
						<td><input class="required" style="width: 250px;" type="text"
							name="designation"id="desig"  /></td>
					</tr>
					<tr>
						<td>Additional Info:</td>
						<td><input class="required"
							style="width: 250px; height: 70px;" type="text" name="addi"id="addinf"  /></td>
					</tr>
					<tr>
						<td>Guranter Name:</td>
						<td><input class="required" style="width: 250px;" type="text"
							name="gname"id="gname" /></td>
					</tr>
					<tr>
						<td>Guranter Phone:</td>
						<td><input class="required" style="width: 250px;" type="tel"
							name="gphone"id="gphone" /></td>
					</tr>
					<tr>
						<td>Guranter Address:</td>
						<td><input class="required" style="width: 250px;" type="text"
							name="gaddress"id="gaddress" style="height:40px;" /></td>
				</table>
			</div>
			<div id="vwevents" style="margin-left: 380px;">
				<img id="photo" src="${WEB_BASE}images/noimage.jpg" alt="your image" />
				<table>
					<tr>
						<td><input type="file" onchange="readURL(this);" class="vw" /></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><input type="button" value="Remove Pic" class="vw"/></td>
						<td><input type="submit" value="Add New" class="vw" /></td>
						<td><input type="submit" value="Add" class="vw" /></td>
					</tr>
				</table>
			</div>
		</form>
	</div>
	<jsp:include page="/jsp/footer.jsp" />
</body>
</html>